package com.huifaapp.mall.adapter;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;

import com.huifaapp.mall.R;
import com.huifaapp.mall.bean.TeamBean;
import com.jcodecraeer.xrecyclerview.XRecyclerView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by duanyu on 2018/1/5.
 */

public class tmall_teamoneFragmentAdapter extends XRecyclerView.Adapter<tmall_teamoneFragmentAdapter.MyViewHolder> {
    private List<TeamBean.DataBean.ListBean>  stringList;
    private Context Context;

    public tmall_teamoneFragmentAdapter(List<TeamBean.DataBean.ListBean> stringList, android.content.Context context) {
        this.stringList = stringList;
        this.Context = context;

    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View recyclerViewItem = LayoutInflater.from(Context).inflate(R.layout.itme_tmall_teamone,parent, false);
            return new MyViewHolder(recyclerViewItem);
    }
    @Override
    public void onBindViewHolder(final MyViewHolder holder, int position) {
        holder .itme_tmallteamoneuserName.setText(stringList.get(position).getUserName());
        holder .itme_tmallteamoneuserPhone.setText(stringList.get(position).getUserPhone());
        holder .itme_tmallteamonecreatTime.setText(stringList.get(position).getTotalSale()+"");
        holder .tv_teamnum.setText(stringList.get(position).getTeamNum()+"");
    }
    @Override
    public int getItemCount() {
        return stringList.size();
    }
        class MyViewHolder extends RecyclerView.ViewHolder {

            private  TextView itme_tmallteamoneuserName;
            private  TextView itme_tmallteamoneuserPhone;
            private  TextView itme_tmallteamonecreatTime;
            private TextView tv_teamnum;

            public MyViewHolder(View itemView) {
                super(itemView);
                itme_tmallteamoneuserName = (TextView) itemView.findViewById(R.id.itme_tmallteamoneuserName);
                itme_tmallteamoneuserPhone = (TextView) itemView.findViewById(R.id.itme_tmallteamoneuserPhone);
                itme_tmallteamonecreatTime = (TextView) itemView.findViewById(R.id.itme_tmallteamonecreatTime);
                tv_teamnum= (TextView) itemView.findViewById(R.id.tv_teamnum);
            }

        }
    }
